home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5683 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  56 lines

  1. Newsgroups: comp.lang.c++
  2. Path: news.iij.ad.jp!mewgate!mitsuru!news
  3. From: tomio@ai.mew.co.jp (Steven J. Madsen)
  4. Subject: Trouble with "system" function in BC++ 3.0
  5. Message-ID: <DMCG2B.LH0@isc.mew.co.jp>
  6. Sender: news@isc.mew.co.jp (USENET News System)
  7. Nntp-Posting-Host: unicorn.ai.mew.co.jp
  8. Organization: Matsushita Electric Works, Ltd., OSAKA, JAPAN
  9. X-Newsreader: Forte Free Agent 1.0.82
  10. Date: Tue, 6 Feb 1996 07:46:31 GMT
  11.  
  12. I am trying to create a very simple .EXE file which will invoke a DOS
  13. EXE command.  I am using the "system" function in BC++ 3.0.
  14.  
  15. The problem I am having is that while my .cpp file compiles okay, the
  16. linker returns an error.
  17.  
  18. Here's the source (I added a call to the "swab" function just to
  19. verify that my project can find the run time library):
  20. ------------------------------------------------------
  21. #include <stdlib.h>
  22. #include <stdio.h>
  23. #include <string.h>
  24.  
  25. char source[15] = "rFna koBlrna d";
  26. char target[15];
  27.  
  28. int main(void)
  29. {
  30.   printf("About to spawn command.com and run a DOS command\n");
  31.   swab(source, target, strlen(source));
  32.   printf("This is target: %s\n", target);
  33.   system("dir");
  34.   return 0;
  35. }
  36.  
  37.  
  38. Here's the warning/error messages:
  39. ----------------------------------
  40. Compiling SYSTEST.CPP:
  41. Linking SYSTEST.EXE:
  42. Linker Warning: No module definition file specified: using defaults
  43. Linker Error: Undefined symbol _system in module SYSTEST.CPP
  44.  
  45.  
  46. The above code compiles and executes fine if I comment out the line
  47. with "system" in it.
  48.  
  49. If possible, please e-mail suggestions to me at:
  50. tomio@ai.mew.co.jp
  51.  
  52. Thanks all.
  53.  
  54.  
  55.  
  56.